package com.lxw.study.behavioral.visitor;


public class Client {
    public static void main(String[] args) {
        Element folder = new FolderElement("code2024");
        Element file = new FileElement("hello.java");

        // 构建对象结构
        FileSystemStructure fileSystem = new FileSystemStructure(folder,file);

        // 创建访问者
        Visitor fileVisitor = new FileNameVisitor();

        // 对象结构接受访问者访问
        fileSystem.accept(fileVisitor);
    }
}
